<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<title>资质证书展示</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="pragma" content="no-cache">
		<script type="text/javascript" src="<%=basePath%>manage/js/jquery.js"></script>
		<script type="text/javascript" src="manage/js/addbg.js"></script>
		<link rel="stylesheet" type="text/css" href="<%=basePath%>manage/css/guanli.css"></link>
		<link rel="stylesheet" type="text/css" href="manage/css/search.css"></link>

	</head>

	<body>
		<h2 class="tableTitle">
			资质证书展示
		</h2>
		<table class="search">
			<tr>

				<form action="findByHQLCoCertificate" methotd="post">
					<td>
						<%--
						证书名称：<input type="text" name="coCertificateName" />
						--%>
						<label for="coCertificateTypeId">
							<strong>证书类别：</strong>
						</label>

						<s:select list="#{0:'全部',1:'营业执照',2:'组织机构代码证',3:'其他'}"
							name="coCertificateTypeId" value="%{coCertificateTypeId}"></s:select>

						<input type="submit" value="查询" />
					</td>
				</form>

				<form action="findAllCoCertificate" method="post">
					<td>
						<input type="submit" value="查询全部" />
					</td>
				</form>

			</tr>
		</table>

		<table class="cssrain">
			<thead>

				<tr>
					<th>
						证书名称
					</th>
					<th>
						发证日期
					</th>
					<th>
						发证单位
					</th>
					<th>
						证书有效期
					</th>
					<th>
						上传日期
					</th>
					<th>
						证书类别
					</th>
					<th colspan="2">
						操作
					</th>
				</tr>
			</thead>
			<tbody>
				<s:if test="!pageBean.list.isEmpty()">
					<s:iterator value="pageBean.list">
						<tr>
							<td>
								<%
									String filePath = request.getAttribute("url")
													.toString();
											String contextPath = request.getRealPath("/");
											String url = filePath.replaceFirst(
													contextPath.replaceAll("\\\\", "\\\\\\\\"), "")
													.replaceAll("\\\\", "/");
								%>
								<a href="<%=url%>" target="_blank"><s:property value="name" />
								</a>
							</td>
							<td>
								<s:property value="issueDate" />
							</td>
							<td>
								<s:property value="issueUnit" />
							</td>
							<td>
								<s:property value="validityPeriod" />
							</td>
							<td>
								<s:property value="uploadDate" />
							</td>
							<td>
								<s:property value="type.name" />
							</td>


							<td>
								<a
									href="deleteCoCertificate.action?coCertificateId=${id}"
									onclick="return confirm('确定要删除吗？')" class="delete">删除</a>
								<a
									href="findByIdCoCertificate.action?coCertificateId=${id}" class="modify">修改</a>
							</td>
						</tr>
					</s:iterator>
				</s:if>
				<s:else>
					<tr>
						<td colspan="7">
							没有记录
						</td>
					</tr>
				</s:else>
			</tbody>
			<tfoot>
				<tr>
					<td colspan="8">
						<div>
							共
							<s:property value="pageBean.allRow" />
							条记录&nbsp;&nbsp; 共
							<s:property value="pageBean.totalPage" />
							页&nbsp;&nbsp; 当前第
							<span><s:property value="pageBean.currentPage" /></span>
							页

							<s:if test="pageBean.currentPage != 1">
								<input type="button" value="首页" class="firstPage"
									onclick="location.href='findAllCoCertificate?page=1'" />
								<input class="frontPage" type="button" value="上一页"
									onclick="location.href='findAllCoCertificate?page=<s:property value="pageBean.currentPage-1"/>'" />
							</s:if>
							<s:else>
								<input class="firstPage" type="button" value="首页" disabled />
								<input class="frontPage" type="button" value="上一页" disabled />
							</s:else>
							<s:if test="pageBean.currentPage < pageBean.totalPage">
								<input class="secondPage" type="button" value="下一页"
									onclick="location.href='findAllCoCertificate?page=<s:property value="pageBean.currentPage+1"/>'" />
								<input class="lastPage" type="button" value="尾页"
									onclick="location.href='findAllCoCertificate?page=<s:property value="pageBean.totalPage"/>'">
							</s:if>
							<s:else>
								<input class="secondPage" type="button" value="下一页" disabled />
								<input class="lastPage" type="button" value="尾页" disabled />
							</s:else>

							<span style="margin: 0 80px 0 5px;"></span>
							<input type="button" value="添加资质证书" class="addPage"
								onclick="window.location.assign('manage/coCertificate/addCoCertificate.jsp');" />
						</div>
					</td>
				</tr>
			</tfoot>
		</table>
	</body>
</html>
